% Analysis of max OD, which generates the maximum calibrated OD within a
% given time windows specified


%% Glucose analysis
max_time_glucose = 60; % Max time (hours)
index_glucose = [1:6 (1:6)+12 (1:6)+24]'; % Index vector of well positions

maxODc_glucose = [];

for k=1:length(index_glucose)
    ODc = sampleplate(index_glucose(k)).OD600_blanked;
    time = sampleplate(index_glucose(k)).time;
    maxODc = max(ODc(time<max_time_glucose));
    
    maxODc_glucose(k) = maxODc;
end
    
maxODc_glucose = maxODc_glucose';
    

%% Succinate analysis
max_time_succinate = 80; % Max time (hours)
index_succinate = [37:42 (37:42)+12 (37:42)+24]'; % Index vector of well positions

maxODc_succinate = [];

for k=1:length(index_succinate)
    ODc = sampleplate(index_succinate(k)).OD600_calibrated_blanked;
    time = sampleplate(index_succinate(k)).time;
    maxODc = max(ODc(time<max_time_succinate));
    
    maxODc_succinate(k) = maxODc;
end
    
maxODc_succinate = maxODc_succinate';
    
%% LB analysis
max_time_LB = 40; % Max time (hours)
index_LB = [19:24 (19:24)+12 (19:24)+24]'; % Index vector of well positions

maxODc_LB = [];

for k=1:length(index_LB)
    ODc = sampleplate(index_LB(k)).OD600_calibrated_blanked;
    time = sampleplate(index_LB(k)).time;
    maxODc = max(ODc(time<max_time_LB));
    
    maxODc_LB(k) = maxODc;
end
    
maxODc_LB = maxODc_LB';
    